package com.zzyl.controller;


import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/alert-data")
public class AlertDataController extends BaseController{
    @Autowired
    private AlertDataService alertDataService;
    @GetMapping("pageQuery")
    public ResponseResult<PageResponse<AlertDataVo>> page(
            @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,
            @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,
            @RequestParam(value = "endTime",required = false)Long endTime,
            @RequestParam(value = "deviceName",required = false)String deviceName,
            @RequestParam(value = "startTime",required = false)Long startTime,
            @RequestParam(value = "status",required = false)Integer status
    ){
        PageResponse<AlertDataVo>pageResponse=alertDataService.page(pageNum,pageSize,endTime,deviceName,startTime,status);
        return success(pageResponse);
    }
}
